<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>add_work</title>
    <script src="/static/aaa_example/js/jquery_3_2_0.js"></script>
    <script src="/static/aaa_example/js/socket.io_4_0_1.js"></script>

    <script>
    // socketio
        var socket = io.connect('http://' + document.domain + ':' + location.port + "/man_hua/add_works/steam");
    
        socket.on('connect', function () {
        });
    
        socket.on('disconnect', function () {
        });

        socket.on('man_hua_down_jie_guo', function (msg) {
            str1=''
            for ( var i in msg){
                str1+=(msg[i]["name"]+":"+msg[i]["jie_g"]+"<br>\n")
            }
            document.getElementById("result").innerHTML=str1
        });

        var int=self.setInterval("send_msg()",1000);
        function send_msg()
        {
            socket.emit("man_hua_down_jie_guo","漫画下载结果获取中");
        }
        // 退出时关闭source
        window.onbeforeunload=function(){
            window.clearInterval(int)
        }
    </script>
</head>
<body>
    <!-- 添加返回首页按钮 -->
    <div>
        <p>
            <a href="/man_hua">
                <button type="button" style="height:80px;width:200px;">返回首页</button>
            </a>
        </p>
    </div>

    <form action="/man_hua/add_works/submit">
        爬虫名:<br>
        <input type="radio" name="spider_name" value="se8">se8<br>
        <input type="radio" name="spider_name" value="aikanhanman">aikanhanman<br>
        <input type="radio" name="spider_name" value="mhua5">mhua5<br>
        <input type="radio" name="spider_name" value="aman5">aman5<br>
        <br>
        漫画名:<br>
        <input type="text" name="name">
        <br>
        漫画url:<br>
        <input type="text" name="url">
        <br><br>
        <input type="submit" value="Submit">
    </form>

    <div id="result"></div>
</body>

</html>